package com.ludomancy.breathe;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Rectangle;

import com.ludomancy.gamelib.ResourceManager;
import com.ludomancy.gamelib.Widget;

public class BannerWidget extends Widget
{
	
	public BannerWidget(Widget parent, Rectangle area)
	{
		super(parent, area);
		ResourceManager.getImage("banner.png");
	}

	public void paint(Graphics g)
	{
		Image img = null;
		switch(Game.game.state)
		{
			case Game.STATE_INTRO:
				img = ResourceManager.getImage("banner.png");
				break;
			case Game.STATE_GAME:
				if(Game.game.isCalm())
				{
					img = ResourceManager.getImage("banner_wool.png");
				}
				else
				if(Game.game.isDesperate())
				{
					img = ResourceManager.getImage("banner_red.png");
				}
				else
				{
					img = ResourceManager.getImage("banner_dark.png");
				}
				break;
			case Game.STATE_DEATH:
				img = ResourceManager.getImage("banner_death.png");
				break;
			case Game.STATE_WIN:
				break;
		}
		if(img != null)
		{
			g.drawImage(img, 0, 0, null);
		}
		else
		{
			g.setColor(new Color(0xE6E5D6));
			g.fillRect(0, 0, getWidth(), getHeight());
		}
	}

}
